package org.create.utils;

import org.create.Application;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;

public class LogTool {
    private static final Logger logger = LoggerFactory.getLogger(Application.class);

    public static void printMsg(String msg) {
        logger.info(msg);
    }

    public static void printError(Exception e) {
        logger.info(e.getMessage());
    }

    public static void printLog(boolean r, String msg, File file) {
        if (r) {
            logger.info("{}: {}", msg, file.getPath());
        } else {
            logger.info("{}: {}", "已创建", file.getPath());
        }
    }

    public static void printLog(String msg, File file) {
        printLog(true, msg, file);
    }
}
